home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 003.dms / 003.adf / TEXT / chapter9.txt < prev    next >
Text File  |  1992-09-02  |  5KB  |  139 lines

  1.  
  2.               The Absolute Beginners Guide To Amos
  3.               -------------------------------------
  4.                          Chapter nine
  5.                          ------------
  6.  
  7. Here are the answers from the self test quiz in chapter eight:
  8.  
  9.                       1. A    6. C
  10.                       2. B    7. A
  11.                       3. C    8. C
  12.                       4. C    9. B
  13.                       5. B   10. B
  14.  
  15. If you got less than five correct, re-read the relevant chapters.
  16. --------------------------------------------------------------------
  17.  
  18. Since we have covered quite a lot of ground I think it`s about time we
  19. concentrated for a while on some programming that will be of a bit more
  20. practical use, although we still have a lot of commands to learn.
  21.  
  22. EXAMPLE9.Amos Is a small piece of code that will LOAD an IFF picture, a 
  23. TRACKer module, display the picture and PLAY the mod. 
  24. When any key is pressed by the user the music will stop and the contents of 
  25. the memory banks of Amos will be displayed. 
  26. All this probably sounds like we have a long program coming up, 
  27. not so, we could fit the whole program on one line if we wanted to.
  28.  
  29. EXAMPLE9.Amos
  30. -------------
  31.  
  32. HIDE
  33.  
  34. LOADIFF "DF0:PICS/SONIC.IFF",0
  35.  
  36. TRACK LOAD "DF0:MUSIC/MOD.FUN",5
  37.  
  38. TRACK PLAY 5
  39.  
  40. TRACK LOOP ON
  41.  
  42. CLEAR KEY
  43.  
  44. WAIT KEY
  45.  
  46. TRACK STOP
  47.  
  48. LISTBANK
  49.  
  50.  
  51. And that is it, neat isn`t it? 
  52.  
  53. HIDE
  54. ----
  55. HIDE the mouse pointer as it`s not needed.
  56.  
  57.  
  58. LOADIFF "DF0:PICS/SONIC.IFF",0
  59. --------------------------
  60. Well covered in an earlier chapter, LOADs an IFF picture into screen 0.
  61.  
  62.  
  63. TRACK LOAD "DF0:MUSIC/MOD.FUN",5
  64. ----------------------------
  65. A new one, the TRACK LOAD command LOADs a TRACKer module into the memory
  66. bank number defined by you after the comma, in this case I used bank five
  67. don`t worry why, we will be covering memory banks soon enough.
  68.  
  69.  
  70. NOTE: If TRACK LOAD throws up a syntax error chances are you are using an old
  71. out of date version of Amos as the TRACK commands were only added in V1.34+ 
  72. of the original Amos package.  I am not sure about Easy Amos as I do not own 
  73. a copy of that, but you will be OK with Amos Pro. If you do have problems
  74. with this you can get an updater disk from most P.D libraries. 
  75. At the time of writing I am using V1.35 of Amos original.
  76.  
  77. NOTE 2: There is a bug in the TRACK LOAD command that forces you to include
  78. the DF0: or DF1: statement at the start like this: TRACK LOAD "DF0: etc.
  79. If you don`t put it you will get an error.  This applies to Amos original.
  80. I am not sure about the other versions.
  81.  
  82.  
  83. TRACK PLAY 5
  84. ------------
  85. This is the command that actually PLAYs the TRACKer music, there are more
  86. options you can add to TRACK PLAY such as pattern number but we don`t need 
  87. to go into that here.  The 5 is the bank we loaded the mod into.  
  88.  
  89.  
  90. TRACK LOOP ON
  91. -------------
  92. AS default TRACK LOOP is set to OFF so the module will only play once and 
  93. then stop. To make the module LOOP continuously we simply set TRACK LOOP ON 
  94. the opposite to this command is TRACK LOOP OFF.  I think there may also be
  95. a bug as some mods I have tried will not loop correctly.
  96.  
  97.  
  98. CLEAR KEY 
  99. ---------
  100. Is a simple but very useful command, CLEAR KEY, CLEARs the keyboard buffer of
  101. any KEY presses currently stored there.  This doesn`t sound that fantastic 
  102. until you start writing a program to detect key presses.  You don`t really
  103. need to understand what it does just remember to use CLEAR KEY before any
  104. WAIT KEY instruction from now on.
  105.  
  106.  
  107. WAIT KEY
  108. --------
  109. We know all about this, WAITs for any KEY press.
  110.  
  111.  
  112. TRACK STOP
  113. ----------
  114. Can you guess what this does? Yes it STOPs the TRACKer music playing.
  115.  
  116.  
  117. LISTBANK
  118. --------
  119. This command is one you wouldn`t normally use inside a program, it`s a system
  120. command really, it displays a LIST of any memory BANKs used like this:
  121.  
  122. 5 - TRACKER  S : $0005664  L : $00000678
  123.  
  124. Or something similar.  This information tells us that bank 5 five contains a
  125. tracker module the S is the start address of the bank and the number after
  126. the L is the length of the bank, the numbers are in Hexadecimal, we will not
  127. be covering Hex in this tutorial as it is of limited use to the beginner.
  128. I won`t go any deeper for now because as I said we will cover banks in 
  129. future chapters.  If you were writing a program and wished to check how many
  130. banks you had in use or whatever, the normal practice would be to press
  131. escape and type in LISTBANK.  The point of me putting LISTBANK at the end of 
  132. the program is to introduce you to the concept of banks gently.
  133.  
  134.  
  135. End of chapter nine.
  136.  
  137.  
  138.   
  139.